#ifndef __SELECT_ITEM_VIEW_H_
#define __SELECT_ITEM_VIEW_H_
#include "cocos2d.h"

using namespace cocos2d;


namespace fireplane
{
	class ClickItemCall
	{
	public:
		virtual void onClickItem(int tag) = 0;
	};

	class SelectItemView : public CCLayer
	{
	public:
		SelectItemView();
		~SelectItemView();

		void init(char** fileName,int arrayCount,CCPoint startPos,ClickItemCall* call);
		void _createMenuItem();
		void _onFocusChange(bool move);
		bool isInAnimation();
		bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
		void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent);
		void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent);
		void onFocusClick(CCObject* pSender);
		void doCall();
	private:

		CCMenuItemSprite** _all_item;
		CCPoint _focus_start_pos;
		float _item_width;
		int _current_focus;
		CCPoint _beginTouchPos;

		CCPoint _startPos;
		char** _all_items_file_name;
		int _count;

		ClickItemCall* _call;
		int _tag;
	};
}

#endif